package yongjian.drp.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import yongjian.drp.dao.ItemDao;
import yongjian.drp.model.Item;

@Component
public class ItemService {

	private ItemDao itemDao;

	public ItemDao getItemDao() {
		return itemDao;
	}
	@Resource
	public void setItemDao(ItemDao itemDao) {
		this.itemDao = itemDao;
	}

	public boolean isExist(String code) {
		return itemDao.isExist(code);
	}

	public void add(Item item) {
		itemDao.add(item);
	}

	public void modify(Item item) {
		itemDao.modify(item);
	}

	public void delete(int id) {
		itemDao.delete(id);
	}

	public List<Item> queryByPage(int page, int rows, String key) {		
		return itemDao.queryByPage(page, rows, key);
	}

	public int getAllRecord(String key) {
		return itemDao.getAllRecord(key);
	}
	
	public List<Item> getAllItem() {		
		return itemDao.getAllItem();
	}
	
}
